<?php
class create_product extends Controller {

	public $viewData;

	function create_product() {
		parent::Controller();

		$this->load->library('cartpool');
		$this->load->library('session');
	}

	function index() {
		if(isset($this->session->userdata['id'])){
			$name = $_REQUEST['name'];
			$category = $_REQUEST['category'];
				
			if($this->cartpool->createProduct($name, $category)){
				echo "succes";
			}else{
				echo "failed";
			}
		}
	}
}